home *** CD-ROM | disk | FTP | other *** search
/ Programmer Power Tools / Programmer Power Tools.iso / tex / dvivga9.arc / MACHDEFS.H < prev    next >
C/C++ Source or Header  |  1988-06-15  |  26KB  |  834 lines

  1. /* -*-C-*- machdefs.h */
  2. /*-->machdefs*/
  3. /**********************************************************************/
  4. /****************************** machdefs ******************************/
  5. /**********************************************************************/
  6.  
  7. /***********************************************************************
  8.  
  9. !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
  10. This file should contain definitions for symbols used for all  operating
  11. system /  implementation  dependencies, and  if  the driver  family  has
  12. already been implemented on  you machine, this should  be the only  file
  13. requiring changes.
  14.  
  15. How to change this file:
  16.     * locate the operating system and implementation definitions;
  17.       they are surrounded by "=====" comment strings.
  18.     * comment out the definitions you do not want, and select the
  19.       ones for your system
  20.     * if adding a new operating system, create a new symbol OS_xxx
  21.       for it and add a new #if OS_xxx ... #endif section for its
  22.       changes.
  23.         * if adding a new implementation for an existing operating
  24.       system, create a new symbol for it and add appropriate
  25.       conditionals inside its #if OS_xxx ... #end section.
  26.     * if you must replace a standard C library function, replace
  27.       instances of its use in the source code with an upper-case
  28.       equivalent (e.g. ungetc --> UNGETC), then define the
  29.       upper-case name below in the generic section, plus the
  30.       operating-system section.
  31.  
  32. !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
  33.  
  34. List of symbols actually used for #if's [14-Aug-87]
  35.  
  36. Flags and strings:
  37.     ALLOW_INTERRUPT    -- allow interactive interrupt
  38.     ANSI_PROTOTYPES    -- draft ANSI C function prototype declarations are
  39.                supported
  40.     ANSI_LIBRARY    -- draft ANSI C library functions conformance
  41.     ARITHRSHIFT    -- implementation uses arithmetic (not logical) right
  42.                shift
  43.     DVIHELP        -- how to find documentation (for usage())
  44.     DVIPREFIX    -- prefix to standard 3-character extension of output
  45.                and log files
  46.     FASTZERO    -- fast bitmap zeroing by external assembly language
  47.                routine
  48.     FONTLIST    -- font type search list (PK, GF, PXL)
  49.     FONTPATH    -- font directory path
  50.     HIRES        -- high resolution variant of bitmap output
  51.     HOST_WORD_SIZE    -- host integer word size in bits
  52.         PS_MAXWIDTH    -- approximate line width limit for PostScript output
  53.     PS_SHORTLINES    -- shorter output lines in PostScript
  54.     PS_XONXOFFBUG    -- PostScript version 23.0 Xon/Xoff bug workaround
  55.     PXLID        -- TeX PXL file ID
  56.     RB_OPEN        -- fopen() mode flags for binary read
  57.     SEGMEM        -- segmented memory (Intel); bitmap is raster vector
  58.     STDRES        -- standard resolution (200 dpi)
  59.     SUBPATH        -- substitution font file path
  60.     TEXFONTS    -- TeX font file path environment variable
  61.     TEXINPUTS    -- TeX input file path environment variable
  62.     USEGLOBALMAG    -- allow runtime global magnification scaling
  63.     VIRTUAL_FONTS    -- implement virtual font caching
  64.     WB_OPEN        -- fopen() mode flags for binary write
  65.     ZAPTHISOUT    -- remove some obsolete code
  66.  
  67. Alternate library routines  for misfeature workarounds  (these have  the
  68. same names as standard library routines, but upper-cased):
  69.     EXIT
  70.     FOPEN
  71.     FSEEK
  72.     FTELL
  73.     GETENV
  74.     MALLOC(n)
  75.     READ
  76.     REWIND(fp)
  77.     UNGETC
  78.  
  79. C Implementations:
  80.     ATT        -- AT&T Unix (System III, V)
  81.     BSD41        -- Berkeley 4.1BSD
  82.     BSD42        -- Berkeley 4.2BSD
  83.     HPUX        -- HP 9000 series Unix (System V based)
  84.     IBM_PC_LATTICE    -- IBM PC Lattice C compiler
  85.     IBM_PC_MICROSOFT-- IBM PC Microsoft Version 3.x or later C compiler
  86.     IBM_PC_WIZARD    -- IBM PC Wizard C compiler
  87.     KCC_20        -- SRI's KCC Compiler on TOPS-20
  88.     PCC_20        -- Portable C Compiler on TOPS-20
  89.  
  90. Operating systems:
  91.     OS_ATARI    -- Atari 520ST+ TOS (similar to MS DOS)
  92.     OS_PCDOS    -- IBM (and clones) PC DOS and MS DOS
  93.     OS_TOPS20    -- DEC-20 TOPS-20
  94.     OS_UNIX        -- Unix (almost any variant)
  95.     OS_VAXVMS    -- VAX VMS
  96.  
  97. Device names (defined in each DVIxxx.C file):
  98.     APPLEIMAGEWRITER -- Apple ImageWriter printer
  99.     BBNBITGRAPH    -- BBN BitGraph terminal
  100.     CANON_A2    -- Canon LBP-8 A2 laser printer
  101.     DECLA75        -- DEC LA75 printer
  102.     DECLN03PLUS    -- DEC LN03-PLUS laser printer
  103.     EPSON        -- Epson 9-pin family dot-matrix printer
  104.     GOLDENDAWNGL100    -- Golden Dawn GL100 laser printer
  105.     HPJETPLUS    -- Hewlett-Packard Laser Jet Plus (downloaded fonts)
  106.     HPLASERJET    -- Hewlett-Packard Laser Jet (bitmap display)
  107.     IMPRESS        -- imPRESS (IMAGEN laser printer)
  108.     MPISPRINTER    -- MPI Sprinter printer
  109.     OKIDATA2410    -- OKIData 2410 printer
  110.     POSTSCRIPT    -- Adobe PostScript (Apple LaserWriter laser printer)
  111.     PRINTRONIX    -- Printronix (DEC LXY-11, C-Itoh) printer
  112.     TOSHIBAP1351    -- Toshiba P-1351 dot matrix printer
  113.  
  114. ***********************************************************************/
  115.  
  116. /**********************************************************************
  117. Define all symbols for devices, operating systems, and implementations
  118. to be explicitly 0, unless it is expected that they might be set at
  119. compile time.
  120. ***********************************************************************/
  121.  
  122. #define ALLOW_INTERRUPT    0
  123. #define ANSI_PROTOTYPES    0
  124.  
  125. #ifndef ANSI_LIBRARY        /* may be specified at compile time */
  126. #define ANSI_LIBRARY    0
  127. #endif
  128.  
  129. #if    ANSI_LIBRARY
  130. #undef ANSI_PROTOTYPES
  131. #define ANSI_PROTOTYPES    1    /* If library conforms, declarations do too */
  132. #endif
  133.  
  134. #define ARITHRSHIFT    1 /* most C compilers use arithmetic right shift */
  135. #define DISKFULL(fp)    (ferror(fp) && (errno == ENOSPC))
  136. #define DVIEXT        ".dvi"
  137. #define DVIPREFIX    "dvi-"
  138. #define EXIT        exit
  139. #define FASTZERO    0
  140.  
  141. /* The following definitions work for at least PCC-20, BSD 4.2 and  4.3,
  142. and HPUX;  VAX  VMS  has  an extra  level  of  indirection.   Check  the
  143. definition of fileno(fp) in stdio.h; on PCC-20, it is
  144.     #define fileno(p) ((p)->_file)
  145. */
  146. #define FILE_CNT(fp)    (fp)->_cnt
  147. #define FILE_BASE(fp)    (fp)->_base
  148. #define FILE_PTR(fp)    (fp)->_ptr
  149.  
  150. /* #define FONTLIST    0 -- can be set at compile time */
  151. /* #define FONTPATH    0 -- can be set at compile time */
  152.  
  153. #define FOPEN        fopen
  154. #define FSEEK        fseek
  155. #define FTELL        ftell
  156. #define GETENV        getenv
  157. #define HIRES        0
  158. #define MALLOC(n)    malloc(n)
  159. #define MAXDRIFT    2    /* we insist that
  160.                 abs|(hh-pixel_round(h))<=MAXDRIFT| */
  161.  
  162. /* MAXOPEN  should  be 6  less  than the  system  limit on  open  files,
  163. allowing for  files  open  on stdin,  stdout,  stderr,  .dvi,  .dvi-log,
  164. .dvi-xxx, plus MAXOPEN font  files.  It may  be additionally limited  by
  165. the amount of memory available for buffers (e.g. IBM PC). */
  166. #define MAXOPEN        14
  167.  
  168. /* #define PS_MAXWIDTH  72 -- can be set at compile time */
  169.  
  170. /* #define PS_SHORTLINES 0 -- can be set at compile time */
  171.  
  172. #define PS_XONXOFFBUG    0
  173. #define PXLID        0
  174. #define RB_OPEN        "r"
  175.  
  176. /* For virtual font caching to succeed, read() must return the requested
  177. number of bytes, and  preferably do this  with one system   call  and no
  178. double buffering. */
  179.  
  180. #define READ        read
  181.  
  182. /* In  many  implementations, rewind(fp)  is  defined as  equivalent  to
  183. fseek(fp,0L,0).  In  some, however  (e.g.  PCC-20,  and probably  others
  184. based on PCC), it additionally discards input buffer contents, which may
  185. cause unnecessary I/O, and in the case of virtual font caching,   clears
  186. the cache.  Defining  it in  terms of fseek()  should be  okay, but  the
  187. implementation of fseek() should be checked. */
  188.  
  189. #define REWIND(fp)    FSEEK(fp,0L,0)
  190.  
  191. #define SEGMEM        0    /* may be reset by dvixxx for big bitmaps */
  192. #define STDRES        0
  193.  
  194. /* #define SUBPATH    0 -- can be set at compile time */
  195.  
  196. #define SUBEXT        ".sub"
  197. #define SUBNAME        "texfonts"
  198.  
  199. /* #define TEXFONTS    0 -- can be set at compile time */
  200. /* #define TEXINPUTS    0 -- can be set at compile time */
  201.  
  202. #define UNGETC        ungetc
  203. #define USEGLOBALMAG    0
  204. #define WB_OPEN        "w"
  205. #define ZAPTHISOUT    0
  206.  
  207.  
  208. /**********************************************************************/
  209. /* Clear all implementation/operating-system flags--reset later */
  210.  
  211. #define ATT        0    /* define zero or one of these */
  212. #define BSD41        0
  213. #define BSD42        0
  214. #define HPUX        0
  215. #define IBM_PC_LATTICE    0
  216. #define IBM_PC_MICROSOFT    0
  217. #define IBM_PC_WIZARD    0
  218. #define KCC_20        0
  219. #define PCC_20        0
  220.  
  221. #define OS_ATARI    0    /* define one of these */
  222. #define OS_PCDOS    0
  223. #define OS_TOPS20    0
  224. #define OS_UNIX        0
  225. #define OS_VAXVMS    0
  226.  
  227. #define APPLEIMAGEWRITER    0    /* one will be defined by DVIxxx */
  228. #define BBNBITGRAPH    0
  229. #define CANON_A2    0
  230. #define DECLA75        0
  231. #define DECLN03PLUS    0
  232. #define EPSON        0
  233. #define GOLDENDAWNGL100    0
  234. #define HPJETPLUS    0
  235. #define HPLASERJET    0
  236. #define IMPRESS        0
  237. #define MPISPRINTER    0
  238. #define OKIDATA2410    0
  239. #define POSTSCRIPT    0
  240. #define PRINTRONIX    0
  241. #define TOSHIBAP1351    0
  242. #define VIRTUAL_FONTS    0
  243.  
  244.  
  245. /***********************************************************************
  246. Define operating system and implementation  here.  Since these have  all
  247. been explicitly set  to 0  above, we  issue #undef's  to avoid  compiler
  248. macro redefinition warning messages.
  249. ***********************************************************************/
  250.  
  251. /*====================
  252. #undef PCC_20
  253. #undef OS_TOPS20
  254. #define PCC_20        1
  255. #define OS_TOPS20    1
  256. ====================*/
  257.  
  258. /*====================
  259. #undef KCC_20
  260. #undef OS_TOPS20
  261. #define KCC_20        1
  262. #define OS_TOPS20    1
  263. ====================*/
  264.  
  265. /*====================
  266. #undef  OS_ATARI
  267. #define OS_ATARI    1
  268. ====================*/
  269.  
  270. /*====================
  271. #undef  IBM_PC_LATTICE
  272. #undef  OS_PCDOS
  273. #define IBM_PC_LATTICE    1
  274. #define OS_PCDOS    1
  275. ====================*/
  276.  
  277.  
  278. #undef  IBM_PC_MICROSOFT
  279. #undef  OS_PCDOS
  280. #define IBM_PC_MICROSOFT    1
  281. #define OS_PCDOS    1
  282.  
  283.  
  284. /*====================
  285. #undef  IBM_PC_WIZARD
  286. #undef  OS_PCDOS
  287. #define IBM_PC_WIZARD    1
  288. #define OS_PCDOS    1
  289. ====================*/
  290.  
  291. /*====================
  292. #undef  OS_VAXVMS
  293. #define OS_VAXVMS    1
  294. ====================*/
  295.  
  296. #if    (OS_ATARI | OS_PCDOS | OS_TOPS20 | OS_UNIX | OS_VAXVMS)
  297. #else
  298. #undef  OS_UNIX
  299. #define OS_UNIX        1        /* provide default operating system */
  300. #endif
  301.  
  302.  
  303. /**********************************************************************/
  304.  
  305. #if    OS_ATARI
  306.  
  307. #undef  BSD42
  308. #define BSD42        1
  309.  
  310. #undef  DISKFULL
  311. #define DISKFULL(fp)    ferror(fp)
  312.  
  313. #define DVIHELP     "type e:\\tex\\dvi.hlp"
  314.  
  315. #ifdef  FONTLIST     /* can be set at compile time */
  316. #else
  317. #define FONTLIST    "PK-GF-PXL"    /* preferred search order */
  318. #endif /* FONTLIST */
  319.  
  320. #ifdef FONTPATH         /* can be set at compile time */
  321. #else
  322. #define FONTPATH    "e:\\tex\\fonts\\"
  323. #endif
  324.  
  325. #define HOST_WORD_SIZE    32    /* must be 32 or larger -- used in */
  326.                 /* signex to pack 8-bit bytes back */
  327.                 /* into integer values, and in dispchar */
  328.                 /* and fillrect for managing character */
  329.                 /* raster storage. */
  330. #define MAXFNAME    64    /* longest host complete filename */
  331.  
  332. #ifndef PS_MAXWIDTH
  333. #define PS_MAXWIDTH    72
  334. #endif
  335.  
  336. #ifndef PS_SHORTLINES
  337. #define PS_SHORTLINES    1
  338. #endif
  339.  
  340. #ifdef SUBPATH            /* can be set at compile time */
  341. #else
  342. #define SUBPATH     "e:\\tex\\inputs\\"
  343. #endif
  344.  
  345. #ifdef TEXINPUTS        /* can be set at compile time */
  346. #else
  347. #define TEXINPUTS    "TEXINPUTS"
  348. #endif
  349.  
  350. #define TEXFONTS    "TEXFONTS"
  351.  
  352. #endif /* OS_ATARI */
  353.  
  354.  
  355. /**********************************************************************/
  356.  
  357. #if    OS_PCDOS
  358.  
  359. #if    IBM_PC_MICROSOFT
  360. #undef ANSI_PROTOTYPES
  361. #define ANSI_PROTOTYPES    1
  362.  
  363. /*
  364. Argument type checking in MSC Version 4.0 is selected by LINT_ARGS.  MSC
  365. Version 5.0 has it selected  by default.  For Version 5.0,  ANSI_LIBRARY
  366. should be defined at compile time  so as to get ANSI-conformant  library
  367. function declarations.  Treating float as double eliminates lots of data
  368. conversion warnings with both Versions 4.0 and 5.0.
  369. */
  370. #define float double    
  371. #define LINT_ARGS    1
  372.  
  373. #undef MALLOC
  374. #define MALLOC(n)    calloc(n,1)
  375. #endif /* IBM_PC_MICROSOFT */
  376.  
  377. #define DVIHELP        "type d:\\tex\\dvi.hlp"
  378.  
  379. #undef DVIPREFIX
  380. #define DVIPREFIX    ""
  381.  
  382. #ifdef FONTLIST        /* can be set at compile time */
  383. #else
  384. #define FONTLIST    "PK-GF-PXL"    /* preferred search order */
  385. #endif /* FONTLIST */
  386.  
  387. #ifdef FONTPATH            /* can be set at compile time */
  388. #else
  389. #define FONTPATH    "d:\\tex\\fonts\\"
  390. #endif /* FONTPATH */
  391.  
  392. #define HOST_WORD_SIZE    32    /* must be 32 or larger -- used in */
  393.                 /* signex to pack 8-bit bytes back */
  394.                 /* into integer values, and in dispchar */
  395.                 /* and fillrect for managing character */
  396.                 /* raster storage. */
  397. #define MAXFNAME    64    /* longest host complete filename */
  398.  
  399. #undef MAXOPEN
  400. #define MAXOPEN        12    /* limit on number of open font files */
  401.  
  402. #ifndef PS_MAXWIDTH
  403. #define PS_MAXWIDTH    72
  404. #endif
  405.  
  406. #ifndef PS_SHORTLINES
  407. #define PS_SHORTLINES    1
  408. #endif
  409.  
  410. #undef  RB_OPEN
  411. #define RB_OPEN        "rb"
  412.  
  413. #ifdef SUBPATH            /* can be set at compile time */
  414. #else
  415. #define SUBPATH        "d:\\tex\\inputs\\"
  416. #endif
  417.  
  418. #if    TEXINPUTS        /* can be set at compile time */
  419. #else
  420. #define TEXINPUTS    "TEXINPUTS"
  421. #endif
  422.  
  423. #define TEXFONTS    "TEXFONTS"
  424.  
  425. #if    IBM_PC_MICROSOFT
  426. #undef VIRTUAL_FONTS
  427. #define VIRTUAL_FONTS    1
  428. #endif
  429.  
  430. #undef  WB_OPEN
  431. #define WB_OPEN        "wb"
  432.  
  433. #endif /* OS_PCDOS */
  434.  
  435.  
  436. /***********************************************************************/
  437. #if    OS_TOPS20
  438.  
  439. /************************************************************************
  440. **
  441. **  Adapted for the DEC-20 TOPS-20  operating system with Jay  Lepreau's
  442. **  PCC-20  by  Nelson  H.F.    Beebe,  College  of  Science   Computer,
  443. **  University of Utah, Salt Lake City, UT 84112, Tel: (801) 581-5254.
  444. **
  445. **  The PCC_20 switch is  used to get around  variations on the  DEC-20.
  446. **  The major one is  that text files have  7-bit bytes, while the  .DVI
  447. **  file and the font files have 8-bit bytes.  For the latter, we use  a
  448. **  routine f20open which provides  the necessary interface for  opening
  449. **  with a ddifferent byte size.  PCC-20 follows many other C  compilers
  450. **  in that only the first 8 characters of identifiers are looked at, so
  451. **  massive substitutions  were  necessary  in the  file  commands.h  to
  452. **  shorten the long names there.
  453. **
  454. **  The PCC_20 switch is also used  to get variant font directory  names
  455. **  and to select TOPS-20 jsys  code.  TOPS-20 is a wonderous  operating
  456. **  system with  capabilities far  beyond  most of  its  contemporaries.
  457. **  Like Topsy, it  just grew, and  consequently, its many  capabilities
  458. **  are not  well  integrated.     The terminal  control  jsys'es  (MTOPR,
  459. **  RFMOD, SFMOD, STPAR, RFCOC, SFCOC and TLINK) are particularly poorly
  460. **  done -- RFMOD returns  the JFN mode word,  particular bits of  which
  461. **  must be set by SFMOD,  STPAR, and TLINK.  Why  could there not be  a
  462. **  "return  the  terminal  state"  and  "restore  the  terminal  state"
  463. **  jsys'es?  Some of this  may in fact be  already integrated into  the
  464. **  PCC-20 C run-time library, but since it is totally undocumented  (an
  465. **  all-too common problem with C),  it is essentially unusable in  that
  466. **  form.
  467. **
  468. **  The OS_TOPS20 switch is used in one place to get ioctl.h included at
  469. **  the right point, and in several places to get error messages  output
  470. **  with Tops-20 conventions in  column 1: query  (?)  causes batch  job
  471. **  abort, percent (%) flags a warning.
  472. **
  473. ***********************************************************************/
  474.  
  475. #if    KCC_20
  476. /* KCC wants all #if symbols defined before use. */
  477. #ifndef FONTLIST
  478. #define FONTLIST "PK-GF-PXL"
  479. #endif
  480.  
  481. #ifndef FONTPATH
  482. #define FONTPATH "TEXFONTS:"
  483. #endif
  484.  
  485. #ifndef SUBPATH
  486. #define SUBPATH "TEXINPUTS:"
  487. #endif
  488.  
  489. #ifndef TEXFONTS
  490. #define TEXFONTS "TEXFONTS:"
  491. #endif
  492.  
  493. #ifndef TEXINPUTS
  494. #define TEXINPUTS "TEXINPUTS:"
  495. #endif
  496.  
  497. #undef VIRTUAL_FONTS
  498. #define VIRTUAL_FONTS 0        /* cannot support this yet */
  499.  
  500. #endif
  501.  
  502. #if    KCC_20
  503. #include <jsys.h>
  504. /* KCC-20 and PCC-20  have similar enough JSYS  interfaces that we  just
  505. define values for KCC-20 using PCC-20 names. */
  506. #define JSchfdb    CHFDB
  507. #define JSmtopr    MTOPR
  508. #define JSrfcoc    RFCOC
  509. #define JSrfmod    RFMOD
  510. #define JSsfcoc    SFCOC
  511. #define JSsfmod    SFMOD
  512. #define JSsti    STI
  513. #define JSstpar    STPAR
  514. #define JStlink    TLINK
  515. #define Getmask(name)      ( 1?name )
  516. #define Getshift(name)     ( 0?name )
  517. #define Absmask(name) ( (1?name) << (0?name) )    /* maybe use this one */
  518. #define Value(name)   ( (1?name) << (0?name) )    /* maybe use this one */
  519. #define makefield(name, value)    ( ((value) & Getmask(name)) << Getshift(name) )
  520. #define getfield(var, name)    ( (var) >> Getshift(name) & Getmask(name) )
  521. #define setfield(var, name, value) ( (var) = ((var) & ~Absmask(name)) |\
  522.     makefield(name, value) )
  523. #endif
  524.  
  525. #if    PCC_20
  526. #undef  ARITHRSHIFT
  527. #define ARITHRSHIFT    0    /* PCC-20 uses logical right shift */
  528. #undef  DISKFULL
  529. #define DISKFULL(fp)    ferror(fp)    /* PCC-20 does not always set errno */
  530. #endif
  531.  
  532. #define DVIHELP    "help dvi\nor\ntype hlp:dvi.hlp\nor\nxinfo local clsc dvi"
  533.  
  534. #if    PCC_20
  535. #undef FASTZERO
  536. #define FASTZERO    1    /* for fast assembly language memory zeroing */
  537. #endif
  538.  
  539. #ifdef FONTLIST        /* can be set at compile time */
  540. #else
  541. #define FONTLIST    "PK-GF-PXL"    /* preferred search order */
  542. #endif /* FONTLIST */
  543.  
  544. #ifdef FONTPATH            /* can be set at compile time */
  545. #else
  546. #define FONTPATH    "/texfonts/"
  547. #endif
  548.  
  549. #undef FOPEN
  550. #define FOPEN        f20open    /* private version for 8-bit binary */
  551.  
  552. #define HOST_WORD_SIZE    36
  553.  
  554. #undef MAXFNAME
  555. #define MAXFNAME    256    /* longest host complete filename */
  556.  
  557. #ifdef KCC_20
  558. #undef MAXOPEN
  559. #define MAXOPEN        26
  560. #endif
  561.  
  562. #ifdef PCC_20
  563. #undef MAXOPEN
  564. #define MAXOPEN        14
  565. #endif
  566.  
  567. #ifndef PS_MAXWIDTH
  568. #define PS_MAXWIDTH    72
  569. #endif
  570.  
  571. #ifndef PS_SHORTLINES
  572. #define PS_SHORTLINES    1
  573. #endif
  574.  
  575. #undef  RB_OPEN
  576. #define RB_OPEN        "rb"
  577.  
  578. #ifdef PCC_20
  579. #undef READ
  580. #define READ        _read    /* fast version with one system call */
  581. #endif
  582.                 /* and single buffering */
  583. #ifdef SUBPATH
  584. #else
  585. #define SUBPATH        "/texinputs/"
  586. #endif
  587.  
  588. #ifdef TEXFONTS            /* can be set at compile time */
  589. #else
  590. #define TEXFONTS    "TEXFONTS"
  591. #endif
  592.  
  593. #ifdef TEXINPUTS        /* can be set at compile time */
  594. #else
  595. #define TEXINPUTS    "TEXINPUTS"
  596. #endif
  597.  
  598. #if    PCC_20
  599. #undef VIRTUAL_FONTS
  600. #define VIRTUAL_FONTS    1
  601. #endif
  602.  
  603. #undef  WB_OPEN
  604. #define WB_OPEN        "wb"
  605.  
  606. /**********************************************************************/
  607. /* The following definitions (down to the endif) are taken from */
  608. /* monsym.h.   It is too big for CPP to handle, so this kludge is */
  609. /* necessary until CPP's tables can be enlarged. */
  610.  
  611. /* selected fields for CHFDB% */
  612. #define CF_nud        01:35-0        /* no update directory */
  613. #define CF_dsp        0777:35-17    /* fdb displacement */
  614. #define CF_jfn        0777777:35-35    /* jfn */
  615.  
  616. #define FBbyv        011        /* retention+bytesize+mode,,# of pages*/
  617. #define FB_ret        077:35-5    /* retention count */
  618.  
  619.  
  620. /* tty mode definitions */
  621.  
  622. #define MOrlw        030        /* read width */
  623. #define MOslw        031        /* set width */
  624. #define MOrll        032        /* read length */
  625. #define MOsll        033        /* set length */
  626.  
  627. #define MOsnt        034        /* set tty non-terminal status */
  628. #define MOsmn        01        /* no system messages(i.e. suppress) */
  629. #define MOsmy        00        /* yes system messages(default) */
  630. #define MOrnt        035        /* read tty non-terminal status */
  631.  
  632. /* fields of jfn mode word */
  633.  
  634. #define TT_osp        01:35-0        /* output suppress */
  635. #define TT_mff        01:35-1        /* mechanical formfeed present */
  636. #define TT_tab        01:35-2        /* mechanical tab present */
  637. #define TT_lca        01:35-3        /* lower case capabilities present */
  638. #define TT_len        0177:35-10    /* page length */
  639. #define TT_wid        0177:35-17    /* page width */
  640. #define TT_wak        017:35-23    /* wakeup field */
  641. #define TT_wk0        01:35-18    /* wakeup class 0 (unused) */
  642. #define TT_ign        01:35-19    /* ignore tt_wak on sfmod */
  643. #define TT_wkf        01:35-20    /* wakeup on formating control chars */
  644. #define TT_wkn        01:35-21    /* wakeup on non-formatting controls */
  645. #define TT_wkp        01:35-22    /* wakeup on punctuation */
  646. #define TT_wka        01:35-23    /* wakeup on alphanumerics */
  647. #define TT_eco        01:35-24    /* echos on */
  648. #define TT_ecm        01:35-25    /* echo mode */
  649. #define TT_alk        01:35-26    /* allow links */
  650. #define TT_aad        01:35-27    /* allow advice (not implemented) */
  651. #define TT_dam        03:35-29    /* data mode */
  652. #define TTbin        00        /* binary */
  653. #define TTasc        01        /* ascii */
  654. #define TTato        02        /* ascii and translate output only */
  655. #define TTate        03        /* ascii and translate echos only */
  656. #define TT_uoc        01:35-30    /* upper case output control */
  657. #define TT_lic        01:35-31    /* lower case input control */
  658. #define TT_dum        03:35-33    /* duplex mode */
  659. #define TTfdx        00        /* full duplex */
  660. #define TT0dx        01        /* not used, reserved */
  661. #define TThdx        02        /* half duplex (character) */
  662. #define TTldx        03        /* line half duplex */
  663. #define TT_pgm        01:35-34    /* page mode */
  664. #define TT_car        01:35-35    /* carrier state */
  665.  
  666. /* tlink */
  667.  
  668. #define TL_cro        01:35-0        /* clear remote to object link */
  669. #define TL_cor        01:35-1        /* clear object to remote link */
  670. #define TL_eor        01:35-2        /* establist object to remote link */
  671. #define TL_ero        01:35-3        /* establish remote to object link */
  672. #define TL_sab        01:35-4        /* set accept bit for object */
  673. #define TL_abs        01:35-5        /* accept bit state */
  674. #define TL_sta        01:35-6        /* set or clear advice */
  675. #define TL_aad        01:35-7        /* accept advice */
  676. #define TL_obj        0777777:35-35    /* object designator */
  677.  
  678. #endif /* OS_TOPS20 */
  679.  
  680. /**********************************************************************/
  681.  
  682. #if    OS_UNIX
  683.  
  684. #undef BSD42
  685. #define BSD42        1        /* want DVISPOOL code in dviterm.h */
  686.  
  687. #define DVIHELP        "man dvi\nor\napropos dvi"
  688.  
  689. #ifdef FONTLIST        /* can be set at compile time */
  690. #else
  691. #define FONTLIST    "PK-GF-PXL"    /* preferred search order */
  692. #endif /* FONTLIST */
  693.  
  694. #ifdef FONTPATH            /* can be set at compile time */
  695. #else
  696. #define FONTPATH    "/usr/lib/tex/fonts/"
  697. #endif
  698.  
  699. #undef MAXOPEN
  700.  
  701. #if    HPUX
  702. #define MAXFNAME    1024    /* longest host complete filename */
  703. #define MAXOPEN        50
  704. #else  /* NOT HPUX */
  705. #define MAXFNAME    256    /* longest host complete filename */
  706. #define MAXOPEN        14
  707. #endif /* HPUX */
  708.  
  709. #ifndef PS_MAXWIDTH
  710. #define PS_MAXWIDTH    72
  711. #endif
  712.  
  713. #ifndef PS_SHORTLINES
  714. #define PS_SHORTLINES    1       /* some Unix utilities fail with long lines */
  715. #endif
  716.  
  717. #ifdef SUBPATH            /* can be set at compile time */
  718. #else
  719. #define SUBPATH        "/usr/lib/tex/macros/"
  720. #endif
  721.  
  722. #if    TEXINPUTS        /* can be set at compile time */
  723. #else
  724. #define TEXINPUTS    "TEXINPUTS"
  725. #endif
  726.  
  727. #if    TEXFONTS            /* can be set at compile time */
  728. #else
  729. #define TEXFONTS    "TEXFONTS"
  730. #endif
  731.  
  732. #define HOST_WORD_SIZE    32    /* must be 32 or larger -- used in */
  733.                 /* signex to pack 8-bit bytes back */
  734.                 /* into integer values, and in dispchar */
  735.                 /* and fillrect for managing character */
  736.                 /* raster storage. */
  737. #endif /* OS_UNIX */
  738.  
  739.  
  740. /**********************************************************************/
  741.  
  742. #if    OS_VAXVMS
  743.  
  744. /***********************************************************************
  745. ** Several standard Unix library functions do not work properly with VMS
  746. ** C, or are not implemented:
  747. **
  748. **    exit()        -- wrong conventions for return code
  749. **    fseek()        -- fails on record-oriented files
  750. **    ftell()        -- fails on record-oriented files
  751. **    getchar()    -- waits for <CR> to be typed
  752. **    getenv()    -- colon- and case-sensitive
  753. **    getlogin()    -- not implemented
  754. **    qsort()        -- not implemented
  755. **    tell()        -- not implemented
  756. **    ungetc()    -- fails for any character with high-order bit set
  757. **    unlink()    -- not implemented (equivalent available)
  758. **
  759. ** The  file  VAXVMS.C  contains   workarounds;  it  must  be   compiled
  760. ** separately and loaded with each of the DVI drivers.
  761. ***********************************************************************/
  762.  
  763. #include <jpidef.h>        /* need for getjpi() in openfont() */
  764.  
  765. #define DVIHELP        "help dvi\nor\ntype tex_inputs:dvi.hlp"
  766. #define EXIT        vms_exit
  767.  
  768. #define FILE_CNT(fp)    (*fp)->_cnt
  769. #define FILE_BASE(fp)    (*fp)->_base
  770. #define FILE_PTR(fp)    (*fp)->_ptr
  771.  
  772. #ifndef FONTLIST        /* can be set at compile time */
  773. #define FONTLIST    "PK-GF-PXL"    /* preferred search order */
  774. #endif /* FONTLIST */
  775.  
  776. #ifndef FONTPATH        /* can be set at compile time */
  777. #define FONTPATH    "TEX_FONTS:" /* Kellerman & Smith VMS TeX */
  778. #endif /* FONTPATH */
  779.  
  780. #define FSEEK        vms_fseek
  781. #define FTELL        vms_ftell
  782. #define GETENV        vms_getenv
  783. #define HOST_WORD_SIZE    32    /* must be 32 or larger -- used in */
  784.                 /* signex to pack 8-bit bytes back */
  785.                 /* into integer values, and in dispchar */
  786.                 /* and fillrect for managing character */
  787.                 /* raster storage. */
  788.  
  789. #define MAXFNAME    256    /* longest host complete filename */
  790.  
  791. #undef MAXOPEN
  792. #define MAXOPEN        14
  793.  
  794. #undef  RB_OPEN
  795. #define RB_OPEN        "rb"
  796.  
  797. #ifndef PS_MAXWIDTH
  798. #define PS_MAXWIDTH    72
  799. #endif
  800.  
  801. #ifndef  PS_SHORTLINES
  802. #define PS_SHORTLINES    1       /* VMS has trouble with long lines */
  803. #endif
  804.  
  805. #define READ        vms_read /* ordinary read() returns only one disk */
  806.                 /* at each call */
  807.  
  808. #ifndef SUBPATH            /* can be set at compile time */
  809. #define SUBPATH        "TEX_INPUTS:" /* Kellerman & Smith VMS TeX */
  810. #endif
  811.  
  812. #ifndef TEXINPUTS        /* can be set at compile time */
  813. #define TEXINPUTS    "TEX_INPUTS:"
  814. #endif
  815.  
  816. #ifndef TEXFONTS        /* can be set at compile time */
  817. #define TEXFONTS    "TEX_FONTS:"
  818. #endif
  819.  
  820. #define UNGETC        vms_ungetc
  821.  
  822. /* VIRTUAL_FONTS cannot be implemented  yet.  The code  works, but the
  823. calls to FSEEK() (vms_seek) result in _filbuf() being called to refill
  824. the buffer, obviating the pre-buffering.  Additional code in case 0 of
  825. vms_seek() can probably be developed to avoid this, but I have run out
  826. of time for now. */
  827.  
  828. #undef  WB_OPEN
  829. #define WB_OPEN        "wb"
  830.  
  831. #endif /* OS_VAXVMS */
  832.  
  833. /**********************************************************************/
  834.